class DamageJudge1Controller < ApplicationController
  def index
    
    @order_item = get_order_item
    @position = get_position
    
    if request.post?
      @order_item.damage_degree = params[:damage_degree]
      if @order_item.damage_degree == "えぐれ"
        @order_item.damage_degree = "へこみ５ｍｍ以下"
      end
      if @order_item.damage_degree == "塗膜のみ"
        @order_item.work_judge = "サフから"
      elsif @order_item.damage_degree == "へこみ５ｍｍ以下"
        @order_item.work_judge = "鈑金パテから"
      else
        @order_item.work_judge = "凹み修正から"
      end
     
      if params[:area_x].to_f < 20.0
        difficulty_judge = false
      else
        difficulty_judge = true
      end
      @order_item.area_x = params[:area_x]
      @order_item.area_y = 10.0
      @order_item.frame_amend_index = 0.0
      redirect_to :controller => :damage_judge, :action => :get_metal_index, :difficulty_judge => difficulty_judge
    end
    
    
  end
end
